package com.func.springsecuritydemo.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * 该监听器用于设置web上下文
 * @author liutianxue
 *
 */
public class CtxListener implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent event) {
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		ServletContext context = event.getServletContext();
		context.setAttribute("ctxPath", context.getContextPath());
	}
	
	

}
